package models
{
    public class StateManager
    {
        public function StateManager()
        {
        }
        
        public static function init(arr:Array):void
        {
            stateArr=[];
            for (var i:int = 0; i < arr.length; i++) 
            {
                stateArr.push(arr[i].name);
            }
        }
        
        public static var stateArr:Array;
        
        public static function find(_state:String):String
        {
            for (var i:int = 0; i < stateArr.length; i++) 
            {
                var state:String = stateArr[i];
                if(state.toLowerCase().indexOf(_state.toLowerCase())>=0)
                    return state;
            }
            
            return null;
        }
    }
}

